package com.itheima.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author robin
 * @version 1.0
 * WebMvcConfigurationSupport： 对springmvc底层很多配置进行封装
 */
@Configuration
@ComponentScan("com.itheima.controller")
public class SpringmvcConfig extends WebMvcConfigurationSupport {

    /**
     * 视图解析器：对逻辑视图进行解析，/WEB-INF/pages/success.jsp
     *
     * @param registry
     */
    @Override
    protected void configureViewResolvers(ViewResolverRegistry registry) {
        registry.jsp("/WEB-INF/pages/", ".jsp");
        super.configureViewResolvers(registry);
    }
}
